//
//  SLLockLogCell.m
//  SlockApp
//
//  Created by 凯朱 on 2024/7/25.
//

#import "SLLockLogCell.h"

@implementation SLLockLogModel
@end

@implementation SLLockLogCell

- (void)awakeFromNib {
   
    [super awakeFromNib];
    self.backgroundColor = KClearColor;
    _crleIcon.layer.cornerRadius = 3;
    _crleIcon.layer.masksToBounds = YES;
}

-(void)setModel:(SLLockLogModel *)model{
    _model = model;
    
    //是告警信息
    if (kSTRING(model.warnType).length > 0) {
        _titleLbl.textColor = KRedColor;
        _timeLbl.textColor = KRedColor;
        NSArray *warnStrs = [ZCTool warnStrWith:[model.warnType integerValue]];
        _titleLbl.text = warnStrs[0];
        _descLbl.text = warnStrs[1];
    }else{
        _titleLbl.textColor = KWhiteColor_text;
        _timeLbl.textColor = KWhiteColor_text;
        if ([model.unlockType isEqualToString:@"1"] || [model.unlockType isEqualToString:@"2"]) {
            _titleLbl.text = kLocalString(@"Unlock via app.");
        }else if ([model.unlockType isEqualToString:@"3"]){
            _titleLbl.text = kLocalString(@"Unlock via Fingerprint.");
        }
        _descLbl.text = kReplace(model.unlockUame, kLocalString(@"Unkown"));
    }
    _timeLbl.text = [NSString timeStringFromTimestamp:model.unlockTime formart:@"HH:mm"];
}


@end
